<?php
class ModelSettingSetting extends Model {
    public function getSetting($group) {
       $data = array();         
       $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "setting WHERE `group` = '" . $this->db->escape($group) . "'");
        
        foreach ($query->rows as $result) {
            $data[$result['key']] = $result['value'];
        }
                
        return $data;
    }
    
    public function getSettingValue($group, $key) {
        $data = '';  
              
        $sql = "SELECT `value` FROM " . DB_PREFIX . "setting WHERE `group` = '" . $this->db->escape($group) . "' AND `key` = '" . $key . "'";
       
        $query = $this->db->query($sql);             
        if($query->num_rows) {
            $data = $query->row['value']; 
        }
                
        return $data;
    }
}
?>